import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
// import vueDevTools from 'vite-plugin-vue-devtools'

// https://vite.dev/config/
export default defineConfig({
    plugins: [
        vue(),
        vueJsx(),
        // vueDevTools(),
    ],
    base: './',
    resolve: {
        alias: {
            '@': fileURLToPath(new URL('./src', import.meta.url))
        },
    },
    server: {
    proxy: {
        '/api': {
            target: 'http://218.23.2.48:9090',
            rewrite: (path) => {
                return '/k8s/v1/namespaces/default/services/w7-registrycache-naumqwnp:8000/proxy-no' + path
            },
            changeOrigin: true
        }
    }
  }
})
